package com.example.juc.until;

import java.util.concurrent.*;

public class CallableAndFutureTask {
    public static void main(String[] args) throws ExecutionException, InterruptedException {


        FutureTask futureTask =new FutureTask(() -> {    //Callable  Lambda 有返回值Callable     无返回值 Runnerable
            System.out.println(Thread.currentThread().getName());
        },"123321");
        new Thread(futureTask,"t1").start();
        new Thread(futureTask,"t2").start();

        System.out.println(  futureTask.get());
    }

}
